package miage.rest.model;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamOmitField;
import java.io.Serializable;
import java.util.Date;
import miage.rest.xml.xstream.converter.annotations.HrefVariable;

/**
 *
 * @author Lou
 */
@XStreamAlias("candidature")
public class Candidature implements Serializable {
    private static final long serialVersionUID = 1L;

	@XStreamAlias("id")
	@XStreamAsAttribute
	@HrefVariable
    private Integer idCandidature;

    private Candidat candidat;

	@XStreamOmitField
    private Integer idCandidat;

    @XStreamOmitField
    private Integer idStatut;

    private Statut statut;

    

    private Integer idSession;

    private Date dateEffet;

    private String commentaire;

    private Integer emailEnvoye;
    
    private String uidLdap;

    public Candidature() {
    }

    public Candidature(Integer idCandidature) {
        this.idCandidature = idCandidature;
    }


    public Candidature(Integer idCandidature, Integer idCandidat, Integer idStatut) {
        this.idCandidature = idCandidature;
        this.idCandidat=idCandidat;
        this.idStatut = idStatut;
        
    }


    public Candidature(Integer idCandidature, Candidat candidat, int idSession, int emailEnvoye) {
        this.idCandidature = idCandidature;
        this.candidat = candidat;
        this.idSession = idSession;
        this.emailEnvoye = emailEnvoye;
    }

    public Integer getIdCandidature() {
        return idCandidature;
    }

    public void setIdCandidature(Integer idCandidature) {
        this.idCandidature = idCandidature;
    }

    public int getIdCandidat() {
    return idCandidat;
    }

    public void setIdCandidat(int idCandidat) {
	this.idCandidat = idCandidat;
    }

    public Candidat getCandidat() {
	return candidat;
    }

    public void setCandidat(Candidat candidat) {
	this.candidat = candidat;
    }

    public int getIdStatut() {
        return idStatut;
    }

    public void setIdStatut(int idStatut) {
        this.idStatut = idStatut;
    }

    public Statut getStatut() {
        return statut;
    }

    public void setStatut(Statut statut) {
        this.statut = statut;
    }

    public int getIdSession() {
        return idSession;
    }

    public void setIdSession(int idSession) {
        this.idSession = idSession;
    }

    public Date getDateEffet() {
        return dateEffet;
    }

    public void setDateEffet(Date dateEffet) {
        this.dateEffet = dateEffet;
    }

    public String getCommentaire() {
        return commentaire;
    }

    public void setCommentaire(String commentaire) {
        this.commentaire = commentaire;
    }

    public int getEmailEnvoye() {
        return emailEnvoye;
    }

    public void setEmailEnvoye(int emailEnvoye) {
        this.emailEnvoye = emailEnvoye;
    }

    public String getUidLdap() {
        return uidLdap;
    }

    public void setUidLdap(String uidLdap) {
        this.uidLdap = uidLdap;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCandidature != null ? idCandidature.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Candidature)) {
            return false;
        }
        Candidature other = (Candidature) object;
        if ((this.idCandidature == null && other.idCandidature != null) || (this.idCandidature != null && !this.idCandidature.equals(other.idCandidature))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "miage.rest.model.Candidature[idCandidature=" + idCandidature + "]";
    }

}
